package cn.school.attendance.dormitory.service;

import cn.school.attendance.dormitory.entity.DormitoryStatusDo;
import cn.school.attendance.dormitory.entity.DormitoryStudentInfo;
import cn.school.attendance.dormitory.pojo.AttendanceDto;
import cn.school.attendance.dormitory.vo.DormitoryAttendanceVo;
import cn.school.attendance.dormitory.vo.StudentAttendanceVO;
import cn.school.basics.vo.BaseSpaceLocationVO;
import cn.school.common.api.CommonPage;
import com.baomidou.mybatisplus.core.metadata.IPage;

import java.util.List;
import java.util.Map;

/**
 * @className: DormitoryAttendanceService
 * @author: Alex
 * @date: 2023/4/1
 **/
public interface DormitoryAttendanceService {

	/**
	 * 查找宿舍考勤状态
	 *
	 * @author alex
	 * @param: vo
	 * @date 2023/4/6 16:07
	 * @return
	 */
	CommonPage<DormitoryStatusDo> findDormitoryAttendanceStatus(BaseSpaceLocationVO vo);

	/**
	 * 查找宿舍对应学生的考勤状态
	 *
	 * @author alex
	 * @param: vo
	 * @date 2023/4/7 15:08
	 * @return
	 */
	List<DormitoryStudentInfo> getDormitoryStudentInfos(BaseSpaceLocationVO vo);

	/**
	 * 修改学生的考勤状态
	 *
	 * @author alex
	 * @param: list
	 * @date 2023/4/8 10:50
	 * @return
	 */
	boolean editAttendanceStatus(List<DormitoryStudentInfo> list);

	/**
	 * 更新考勤状态
	 *
	 * @author alex
	 * @param: params
	 * @date 2023/7/31 16:07
	 * @return
	 */
	int updateAttendanceStatus(DormitoryAttendanceVo vo);


	//	 ================================ new attendance service=========================================


	/**
	 * 查询所有宿舍的考勤统计数据
	 * @param query
	 * @return
	 */
	Map<String, Object> getAttendanceStatsByDay(AttendanceDto query);

	/**
	 * 查询某一栋宿舍的所有考勤数据
	 * @param query
	 * @return
	 */
	List<Object> getAttendanceStatsByBuildAndDay(AttendanceDto query);

	List<StudentAttendanceVO> getAttendanceStatsByLocationAndDay(AttendanceDto query);

	int updateAttendance(StudentAttendanceVO dto);

	boolean updateAttendanceStatusBatch(List<StudentAttendanceVO> list);

	IPage<StudentAttendanceVO> getStudentAttendanceList(Map<String,String> query);
}
